package com.mioto.ld.communication.websocket.model;

import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @author mioto-qinxj
 * @date 2024/6/12
 * @desc
 */
@Getter
@Setter
@AllArgsConstructor
public class MessageNotifyBody {

    /**
     * 设备序列号
     */
    private String deviceSn;
    /**
     * 模板标题
     */
    private String title;
    /**
     * 模板内容
     */
    private String content;
    /**
     * 通知时间
     */
    private Date date;

    @Override
    public String toString() {
        return JSONUtil.createObj()
                .accumulate("deviceSn",deviceSn)
                .accumulate("title",title)
                .accumulate("content",content)
                .accumulate("date", DateUtil.formatDateTime(date))
                .toString();
    }
}
